package com.yjc.hire.service.impl;

import com.yjc.hire.VO.AdminVO;
import com.yjc.hire.bo.UpdateAdminBO;
import com.yjc.hire.mapper.AdminMapper;
import com.yjc.hire.service.AdminService;
import com.yjc.pojo.Admin;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * </p>
 *
 * @author jcyin
 * @since 2025/7/22
 * </p>
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public Admin getById(String userId) {
        Admin admin = adminMapper.selectById(userId);
        return admin;

    }

    @Override
    public void update(UpdateAdminBO bo) {
        Admin admin = new Admin();
        BeanUtils.copyProperties(bo, admin);
        admin.setUpdatedTime(LocalDateTime.now());
        adminMapper.updateById(admin);
    }
}
